const baseURL="http://dev.woniulab.com:7689";
function request({url,method="get",data}={}){
	uni.showLoading({
		title:"加载中"
	})
	return new Promise((resolve,reject)=>{
		uni.request({
			url:baseURL+url,
			method,
			data,
			success:res=>{
				resolve(res.data)
				// console.log(res)
			},
			fail(){
				uni.showToast({
					title:"网络错误",
					duration:2000
				})
			},
			complete:()=>{
				uni.hideLoading();
			}
		})
	})
	
}
export default request;